package com.yanqu.road.entity.activity.douluodalu.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.activity.douluodalu.DouLuoDaLuAttackInfo;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_c_douluodalu_help_record")
public class DouLuoDaLuHelpRecordData extends DataObject {
    @FieldTypeAnnotation(update = true)
    private long id;
    @FieldTypeAnnotation(update = true)
    private int groupId;
    @FieldTypeAnnotation(select = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "求助玩家的id")
    private long userId;
    @FieldTypeAnnotation(desc = "区域id")
    private int regionId;
    @FieldTypeAnnotation(desc = "事件id")
    private int eventId;
    @FieldTypeAnnotation(desc = "目标id")
    private long targetId;
    @FieldTypeAnnotation(desc = "目标剩余血量")
    private long targetBlood;
    @FieldTypeAnnotation(desc = "目标总血量")
    private long targetTotalBlood;
    @FieldTypeAnnotation(desc = "协助伤害信息集合,k:玩家id,v:攻击信息")
    private Map<Long, DouLuoDaLuAttackInfo> helpAttackMap = new ConcurrentHashMap<>();
    @FieldTypeAnnotation(desc = "目标被击杀的玩家id。未被击杀为0,如果killedUserId=userId,说明有资格领取奖励， -1表示无效 隔天过期了或者")
    private long killedUserId;
    @FieldTypeAnnotation(desc = "是否领取过奖励")
    private boolean isReceived;
    @FieldTypeAnnotation(desc = "可以领取的奖励")
    private String reward = "";
    @FieldTypeAnnotation(desc = "可以领取的魂环奖励")
    private String hunHuan = "";
    @FieldTypeAnnotation(desc = "求助时间")
    private long recordTime;
    @FieldTypeAnnotation(desc = "事件时间")
    private int eventTIme;
    @FieldTypeAnnotation(desc = "击杀时间")
    private long killTime;

    public DouLuoDaLuHelpRecordData() {
    }

    public DouLuoDaLuHelpRecordData(long id, int groupId, int activityId) {
        this.id = id;
        this.groupId = groupId;
        this.activityId = activityId;
        setInsertOption();
    }

    public void setId(long id) {
        if (this.id != id) {
            this.id = id;
            setOp(DataStatus.Update);
        }

    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }

    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getRegionId() {
        return regionId;
    }

    public void setRegionId(int regionId) {
        if(this.regionId != regionId){
            this.regionId = regionId;
            setUpdateOption();
        }
    }

    public void setEventId(int eventId) {
        if (this.eventId != eventId) {
            this.eventId = eventId;
            setOp(DataStatus.Update);
        }

    }
    public void setTargetId(long targetId) {
        if (this.targetId != targetId) {
            this.targetId = targetId;
            setOp(DataStatus.Update);
        }

    }
    public void setTargetTotalBlood(long targetTotalBlood) {
        if (this.targetTotalBlood != targetTotalBlood) {
            this.targetTotalBlood = targetTotalBlood;
            setOp(DataStatus.Update);
        }

    }
    public void setKilledUserId(long killedUserId) {
        if (this.killedUserId != killedUserId) {
            this.killedUserId = killedUserId;
            setOp(DataStatus.Update);
        }

    }
    public void setIsReceived(boolean isReceived) {
        if (this.isReceived != isReceived) {
            this.isReceived = isReceived;
            setOp(DataStatus.Update);
        }

    }

    public void setRecordTime(long recordTime) {
        if (this.recordTime != recordTime) {
            this.recordTime = recordTime;
            setOp(DataStatus.Update);
        }

    }

    public String getHunHuan() {
        return hunHuan;
    }

    public void setHunHuan(String hunHuan) {
        this.hunHuan = hunHuan;
        setUpdateOption();
    }

    public void setReward(String reward) {
        if(null == reward){
            return;
        }
        if(!this.reward.equals(reward)) {
            this.reward = reward;
            setOp(DataStatus.Update);
        }
    }

    public void setHelpAttackMap(Map<Long, DouLuoDaLuAttackInfo> helpAttackMap) {
        this.helpAttackMap = helpAttackMap;
        setUpdateOption();
    }

    public long getId() {
        return id;
    }

    public int getActivityId() {
        return activityId;
    }

    public long getUserId() {
        return userId;
    }

    public int getEventId() {
        return eventId;
    }

    public long getTargetId() {
        return targetId;
    }

    public Map<Long, DouLuoDaLuAttackInfo> getHelpAttackMap() {
        return helpAttackMap;
    }

    public long getKilledUserId() {
        return killedUserId;
    }

    public boolean isReceived() {
        return isReceived;
    }

    public long getRecordTime() {
        return recordTime;
    }

    public int getEventTIme() {
        return eventTIme;
    }

    public void setEventTIme(int eventTIme) {
        if(this.eventTIme != eventTIme) {
            this.eventTIme = eventTIme;
            setUpdateOption();
        }
    }

    public long getKillTime() {
        return killTime;
    }

    public void setKillTime(long killTime) {
        if(this.killTime != killTime) {
            this.killTime = killTime;
            setUpdateOption();
        }
    }

    public long getTargetTotalBlood() {
        return targetTotalBlood;
    }

    public String getReward() {
        return reward;
    }

    public long getTargetBlood() {
        return targetBlood;
    }

    public void setTargetBlood(long targetBlood) {
        if(this.targetBlood != targetBlood) {
            this.targetBlood = targetBlood;
            setUpdateOption();
        }
    }
}
